import { useComponentsStore, Component } from "@/stores/edit-pages-store";
import {renderProdComponents} from "./renderProdComponents"

export function Preview(props:{apiSchema?: Component, className?: string}){
  const { apiSchema, className='' } = props
  const { schema } = useComponentsStore();
  const renderSchema = apiSchema || schema
  const renderComponents = renderProdComponents([renderSchema])
  return <div className={`bg-gray-100 flex-1 h-20 ${className}`}>
    {renderComponents()}
  </div>
}